
<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>作业管理</title>

<script type="text/javascript" src="easyui/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="easyui/jquery.easyui.min.js"></script>
<link rel="stylesheet" type="text/css" href="easyui/themes/icon.css" />
<link rel="stylesheet" type="text/css"
	href="easyui/themes/default/easyui.css" />
<link href="css/main.css" rel="stylesheet" type="text/css" />
<link href="css/loads.css" rel="stylesheet" type="text/css" />
<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->	

</head>

<body>
	<div class="button">		

		作业状态：<select id="status">
		    <option value="all">全部</option>
			<option value="already">已完成</option>
			<option value="unalready">未完成</option>
		</select> <input type="submit" id='searchwork' value="搜索" />
	</div>
	<form >
		<input type="hidden" name="action" value="delete" />
		<table class="homework" cellpadding="0" cellspacing="0">
		</table>
	</form>
	<div id="dd"></div>
	<div id="aa"></div>

	<script type="text/javascript">
		$(document).ready(function() {
		
         $('.homework').datagrid({
 	url:'homework_manage/student/queryself.jsp',
	pagination:true,
	columns:[[
			{field:'taskid',title:'作业编号',width:100},
			{field:'name',title:'布置作业者',width:100},
			{field:'taskname',title:'作业名称',width:100},
			{field:'status',title:'作业进度',width:100},										
			{field:'detail',title:'作业详情',width:100},
			{field:'hand',title:'提交作业',width:100},
			{field:'endtime',title:'截止时间',width:100},
			{field:'isappend',title:'有无附件',width:100},
			   //里面显示    更改 
			{field:'cut',checkbox:true },
		]],
		onClickCell:function(rowIndex, field, value){
				 
       
		$(this).click(function(){
		$(this).css("color","red");
		$('#dd').dialog({
			  onClose:function(){
				$("td").css("color","black");  
			  }
		});
		})
		if(field=='detail'){
		
        var rows = $('.homework').datagrid('getSelections');        
		if (!rows || rows.length == 0) {
         alert("没有选上数据!");}  
         var id=rows[0].taskid;
          //alert(id);
     
			   
			 $('#dd').dialog({
		         title:"作业详情",
				 zIndex:9001,
				 width:700, height:500,
				 top:150,left:400,
				 cache:false,
				 resizable:true,
				href:'homework_manage/student/work_detail.jsp?id='+id//！！！！后台请注意获取的时候检测一下
		   });
		   
		    $('#dd').dialog('refresh', 'homework_manage/student/work_detail.jsp?id='+id);
			}else if(field=='hand'){
			
			  var rows = $('.homework').datagrid('getSelections');        
		if (!rows || rows.length == 0) {
         alert("没有选上数据!");}  
         var id=rows[0].taskid;
          //alert(id);
     
			 $('#dd').dialog({
		         title:"提交作业",
				 zIndex:9001,
				 width:700, height:500,
				 top:150,left:400,
				 cache:false,
				 resizable:true,
				href:'homework_manage/student/handwork.jsp?id='+id//！！！！后台请注意获取的时候检测一下如果是两级还是三级
				 });
			  $('#dd').dialog('refresh','homework_manage/student/handwork.jsp?id='+id);
			 
			 
				 }
		   
		
		
		}
		
		
           })
			
	    
	
	 /*搜索处理*/
$("#searchwork").click(function(){
var status = $("#status").val();

$(".homework").datagrid('load',{"status":status});
	})
	  
	    	
		})
	</script>
</body>
</html>

